]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Hide message list when all sections are disallowed
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 3 Mar 2015 01:04:37 +0000 (02:04 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 3 Mar 2015 18:14:49 +0000 (19:14 +0100)
If none of the sections is allowed to display anything, it doesn't
make sense to show the message list at all, so hide it in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=745494

js/ui/calendar.js

index 1c47b74e712e032481a99c0bc471493dfd6d7f73..e325a8dc519720e0267d8488c24eab891cc6a59b 100644 (file)
@@ -1730,6 +1730,8 @@ const MessageList = new Lang.Class({
 
         this._eventsSection = new EventsSection();
         this._addSection(this._eventsSection);
+
+        Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
     },
 
     _addSection: function(section) {
@@ -1772,7 +1774,15 @@ const MessageList = new Lang.Class({
     },
 
     _sync: function() {
-        let showPlaceholder = [...this._sections.keys()].every(function(s) {
+        let sections = [...this._sections.keys()];
+        let visible = sections.some(function(s) {
+            return s.allowed;
+        });
+        this.actor.visible = visible;
+        if (!visible)
+            return;
+
+        let showPlaceholder = sections.every(function(s) {
             return s.empty || !s.actor.visible;
         });
         this._placeholder.actor.visible = showPlaceholder;